This should allow the rest of the tests to run without reporting
failure because this test killed the console system.
from Test import *
+TIMEDOUT = 1
+RUNAWAY = 2
+
class ConsoleError(Exception):
- def __init__(self, msg):
+ def __init__(self, msg, reason=TIMEDOUT):
self.errMsg = msg
+ self.reason = reason
def __str__(self):
return str(self.errMsg)
if self.limit and bytes >= self.limit:
raise ConsoleError("Console run-away (exceeded %i bytes)"
- % self.limit)
+ % self.limit, RUNAWAY)
if self.debugMe:
print "Ignored %i bytes of miscellaneous console output" % bytes
if self.limit and bytes >= self.limit:
raise ConsoleError("Console run-away (exceeded %i bytes)"
- % self.limit)
+ % self.limit, RUNAWAY)
if str == "\n":
if lines > 0:
# See if this hits the byte limit
console.runCmd("ls")
except ConsoleError, e:
- FAIL(str(e))
+ if e.reason == RUNAWAY:
+ # Need to stop the domain before we restart the console daemon
+ domain.destroy()
+ if verbose:
+ print "*** Attempting restart of xenconsoled"
+ s, o = traceCommand("killall xenconsoled")
+ s, o = traceCommand("xenconsoled")
+ if s != 0:
+ print "*** Starting xenconsoled failed: %i" % s
+ FAIL("Bug #380: I crashed the console system")
+ else:
+ FAIL(str(e))
domain.destroy()